Task synchronization  
Previous  Top  Next

 
Let us try to make the task described in the previous section a bit more complicated. Suppose you need to pack three folders in three different files and then write them to a CD. As you remember, we have started three different tasks to pack the folders. It means that we must wait until all three tasks are finished before we can write the archives to a CD.  
The "Wait for Task" action is used for that. Let us modify our task in the following way:  
 
Start task "Pack folder1" without waiting  
Start task "Pack folder2" without waiting  
Start task "Pack folder3" without waiting  
Wait for Task "Pack folder1" for 10 min.  
Wait for Task "Pack folder2" for 10 min.  
Wait for Task "Pack folder3" for 10 min.  
Write files folder1.zip, folder2.zip, folder3.zip to CD  
 
Thus, we start three simultaneous processes in order to pack the necessary data and after all three processes are sure to be finished, we write the archive files to a CD.  
 
note Related Topics  
Running tasks simultaneously  
Wait for Task